package com.xjwn.datasync.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.sql.Connection;
import java.sql.DriverManager;

@RestController
public class TsetController {


    @RequestMapping("/sqlserver")
    public static void testsql(String[] args) {
        String url = "jdbc:sqlserver://192.168.4.137:1433;databaseName=xjwnzsk;user=sa;password=Sq_123456;encrypt=false;loginTimeout=30;logLevel=2;";
//        String user = "sa";
//        String password = "Sq_123456";

        try (Connection conn = DriverManager.getConnection(url)) {
            System.out.println("连接成功 ✅");
        } catch (Exception e) {
            System.out.println("连接失败 ❌：" + e.getMessage());
        }
    }
}
